<%--                                                                       --%>
<%-- Copyright (c) 2004-2005 BroadVision, Inc.  All rights reserved.       --%>
<%--                                                                       --%>
<%-- This software is copyrighted. Under the copyright laws, this software --%>
<%-- may not be copied, in whole or in part, without prior written consent --%>
<%-- of BroadVision, Inc. or its assignees. This software is provided      --%>
<%-- under the terms of a license between BroadVision and the recipient,   --%>
<%-- and its use is subject to the terms of that license.                  --%>
<%--                                                                       --%>
<%-- This software may be protected by one or more U.S. and International  --%>
<%-- patents.  Certain applications of BroadVision One-To-One software are --%>
<%-- covered by U.S. patent 5,710,887.                                     --%>
<%--                                                                       --%>
<%-- TRADEMARKS: BroadVision and BroadVision One-To-One are registered     --%>
<%-- trademarks of BroadVision, Inc., in the United States and the         --%>
<%-- European Community, and are trademarks of BroadVision, Inc., in other --%>
<%-- countries.  The BroadVision logo, is a trademark of BroadVision,      --%>
<%-- Inc., in the United States and other countries. Additionally, IONA    --%>
<%-- and Orbix are trademarks of IONA Technologies, Ltd.  RSA, MD5, and    --%>
<%-- RC2 are trademarks of RSA Data Security, Inc.                         --%>
<%--                                                                       --%>

<%@ taglib uri="/WEB-INF/c.tld" prefix="c" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html-el.tld" prefix="html-el" %>

<%
  String ctxPath = request.getContextPath();
%>

<script language="javascript">

//
//
//
function doQualifierView(qualifierId) {
  var action = '<c:url value="/ep/qualifierView.do"/>';
  if (action.indexOf("?") == -1) {
    action += "?";
  }
  action += "qualifierId=" + qualifierId;

  document.epQualifierListForm.action = action;
  document.epQualifierListForm.submit();
}

//
//
//
function doQualifierEdit(qualifierId) {
  document.epQualifierListForm.qualifierId.value = qualifierId;
  document.epQualifierListForm.action = '<c:url value="/ep/qualifierEdit.do"/>';
  document.epQualifierListForm.submit();
}

//
//
//
function doQualifierDelete(qualifierId) {
  if (confirm('<bean:message key="ep.qualifier.confirm.delete" bundle="ep.messages"/>')) {
    document.epQualifierListForm.qualifierId.value = qualifierId;
    document.epQualifierListForm.action = '<c:url value="/ep/qualifierDelete.do"/>';
    document.epQualifierListForm.submit();
  }
}

<%@ include file="/mc/common/jsutils.jsp" %>

</script>

<c:set var="editImg">
<img src="<%= ctxPath %>/ep/images/action/icon_edit.gif" width="15" height="15" border="0" class="actionIcon" alt="<bean:message key="image.alt.edit" bundle="ep.messages"/>" title="<bean:message key="image.alt.edit" bundle="ep.messages"/>">
</c:set>
<c:set var="deleteImg">
<img src="<%= ctxPath %>/ep/images/action/icon_delete.gif" width="15" height="15" border="0" class="actionIcon" alt="<bean:message key="image.alt.delete" bundle="ep.messages"/>" title="<bean:message key="image.alt.delete" bundle="ep.messages"/>">
</c:set>

<table class="zoneFive" width="100%" border="0" cellspacing="0" cellpadding="0" summary="content area">
  <tr>
    <td valign="top" width="100%">
      <div class="pageTitle">
      <bean:message key="ep.qualifiers.manage.page.title" bundle="ep.messages"/>
      </div>
      <div class="errorMessage"><html-el:errors bundle="ep.messages"/></div>
      
      <!-- place body here start -->

<form name="epQualifierListForm" method="post">

<input type="hidden" name="qualifierId"/>

      <div class="pageSubtitle">
        <span class="left"><bean:message key="ep.qualifiers" bundle="ep.messages"/></span>
        <span class="right"><input type="button" class="inputButton" value="<bean:message key="button.new.qualifier" bundle="ep.messages"/>" onclick="doAction('/ep/qualifierNew.do', this.form);"></span>
      </div>

<c:if test="${not empty qualifierListView.map.qualifiers}">
      <div class="globalButtonWrap">
        <input type="button" name="selectAllQualifiers" class="globalButton" value="<bean:message key="button.selectAll" bundle="ep.messages"/>"
          onclick="check(this.form.qualifierIds, this);">
        <input type="button" class="globalButton" value="<bean:message key="button.delete" bundle="ep.messages"/>"
          onclick="if (isAnyChecked(this.form.qualifierIds, '<bean:message key="ep.qualifier.atLeastOne" bundle="ep.messages"/>', '<bean:message key="ep.qualifiers.confirm.delete" bundle="ep.messages"/>')) doAction('/ep/qualifierDelete.do', this.form);">
      </div>
</c:if>

      <table class="dataTable" border="0" cellspacing="1" cellpadding="2" summary="Search result table" width="100%">
        <tr class="listHeader">
          <th id="Checkboxes">&nbsp;</th>
          <th id="Name" align="left"><bean:message key="ep.header.name" bundle="ep.messages"/></th>
          <th id="LastModifiedDate" align="left"><bean:message key="ep.header.lastModifiedDate" bundle="ep.messages"/></th>
          <th id="Actions" align="left" nowrap><bean:message key="ep.header.actions" bundle="ep.messages"/></th>
        </tr>

        <!-- results -->
<c:forEach var="item" items="${qualifierListView.map.qualifiers}" varStatus="index">
	  <c:choose>
	    <c:when test="${(index.count + 1) % 2 == 0}">
	      <tr class="listEven">
	    </c:when> 
	    <c:otherwise>
	      <tr class="listOdd">
	    </c:otherwise>
	  </c:choose> 
          <td headers="Checkboxes" align="center"><input type="checkbox" name="qualifierIds" value='<c:out value="${item.map.qualifierId}"/>'></td>
          <td headers="Name"><a href="#" onclick="doQualifierView(<c:out value="${item.map.qualifierId}"/>);"><c:out value="${item.map.qualifierName}"/></a></td>
          <td headers="LastModifiedDate"><bean:write name="item" property="lastModifiedTime" formatKey="format.datetime.short" bundle="mc.messages"/></td>
          <td headers="Actions">
            <a href="#" onclick="doQualifierEdit(<c:out value="${item.map.qualifierId}"/>);"><c:out
              value='${editImg}' escapeXml="false"/></a> 
            <a href="#" onclick="doQualifierDelete(<c:out value="${item.map.qualifierId}"/>);"><c:out
              value='${deleteImg}' escapeXml="false"/></a>
          </td>
        </tr>
</c:forEach>
</form>

      </table>

      <!-- pagination -->
<%@ include file="/mc/common/pager.jsp" %>

<!-- place body here end -->

    </td>
  </tr>
</table>
